package cn.tedu.egweibo1.controller;

import cn.tedu.egweibo1.base.response.JsonResult;
import cn.tedu.egweibo1.mapper.UserMapper;
import cn.tedu.egweibo1.pojo.dto.UserAddParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Options;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/v1/user/")
@ResponseBody
public class UserController {
    @Autowired
    private UserMapper userMapper;
    @Operation(summary = "用户注册")
    @ApiOperationSupport(order = 10)
    @PostMapping("add")
    public JsonResult UserAddParam(@RequestBody UserAddParam userAddParam){
        log.debug("用户注册参数："+userAddParam);
        int i = userMapper.insertUser(userAddParam);
        return JsonResult.ok(userAddParam);
    }

}
